/*  
*/
#include <stdio.h>
#include <string.h>

#include "hal.h"
#include "bc20.h"
#include "at.h"
#include "duplex.h"

#define TIMER_COUNT (0x08 - 1)

void at_config(void);
void at_machine_start(void);

static uint32_t nMs = 0;

void timer_counter(void)
{
    nMs++;
}

int main(void)
{
      x_set_at_duplex_dbg(USER_AT_CMD_ECHO | RAW_AT_UART_ECHO);
            dbg_init();
    at_duplex_init();
    at_config();
    
dbg_printf("bc20 config.\n");
    
      ioctl_init();
    bc20_turn_on();
    

    //timer_init();
    //timer_callback(timer_counter);
    
    dbg_printf("sys start\n");
    

    

    //bc20_reset();
    
    
    //at_machine_start();
    //at_duplex_send("AT+CPIN?\r\n");
    
    while(1)
    {
        at_test();
        //at_machine();
        //if(TIMER_COUNT == (nMs & TIMER_COUNT))
        {
            //nMs++;
            //dbg_printf("timing...\n");
        }
    }
}

// end of file -----------------------------------------------------------------


